/* vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4: */
/* Copyright (C) 2012 Zongyou Yao. All rights reserved.     */

#ifndef ARRAYREP_INCLUDED
#define ARRAYREP_INCLUDED

/**
 * It is an unchecked runtime error to change the fields in a array_t.
 */
struct array_t {
    int length;
    int size;
    char *array;
};

/**
 * Initializes the fields in array to the values of length, size, and ary.
 * It is a checked runtime error for length != 0 and ary = null,
 * length = 0 and ary != null, or size <= 0. It is an unchecked runtime error
 * to initialize a array_t by other means.
 */
void arrayrep_init(array_t array, int length, int size, void *ary);

#endif
